const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 配件管理路由
const routers = [
  {
    path: '/serviceass',
    meta: {
      title: '服务管理',
      icon: 'el-icon-s-cooperation'
    },
    redirect: '/serviceass',
    component: RouteView,
    children: [
      {
        path: '/serviceass/pdimanage',
        meta: {
          title: 'PDI管理'
        },
        redirect: '/serviceass/pdimanage',
        component: RouteView,
        children: [{
          path: '/serviceass/pdimanage/area',
          meta: {
            title: 'PDI检查区域维护',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/area')
        },
        {
          path: '/serviceass/pdimanage/project',
          meta: {
            title: 'PDI检查项目维护',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/project')
        },
        {
          path: '/serviceass/pdimanage/meetingcar',
          meta: {
            title: '接车PDI维护',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/meetingcar')
        },
        {
          path: '/serviceass/pdimanage/stock',
          meta: {
            title: '库存PDI维护',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/stock')
        },
        {
          path: '/serviceass/pdimanage/actualSales',
          meta: {
            title: '实销PDI维护',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/actualSales')
        },
        {
          path: '/serviceass/pdimanage/pdiquery',
          meta: {
            title: '销售公司PDI查询',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/pdiquery')
        },
        {
          path: '/serviceass/pdimanage/pdidealerquery',
          meta: {
            title: '经销商PDI查询',
            keepAlive: true
          },
          component: AsyncComponent('serviceass/pdimanage/pdidealerquery')
        }
        ]
      },
      {
        path: '/serviceass/batteryService',
        meta: {
          title: '电池维修信息管理'
        },
        redirect: '/serviceass/batteryService',
        component: RouteView,
        children: [
          {
            path: '/serviceass/batteryService/relationship',
            meta: {
              title: '电池维修信息对应关系',
              keepAlive: true
            },
            component: AsyncComponent('serviceass/batteryService/relationship')
          },
          {
            path: '/serviceass/batteryService/booking',
            meta: {
              title: '电池预约单',
              keepAlive: true
            },
            component: AsyncComponent('serviceass/batteryService/booking')
          },
          {
            path: '/serviceass/batteryService/repair',
            meta: {
              title: '电池维修信息查询',
              keepAlive: true
            },
            component: AsyncComponent('serviceass/batteryService/repair')
          }
        ]
      },
      {
        path: '/serviceass/qualityManage',
        meta: {
          title: '质量信息管理'
        },
        redirect: '/serviceass/qualityManage',
        component: RouteView,
        children: [
          {
            path: '/serviceass/qualityManage/feedback',
            meta: {
              title: '质量报告反馈',
              keepAlive: true
            },
            component: AsyncComponent('serviceass/qualityManage/feedback')
          },
          {
            path: '/serviceass/qualityManage/audit',
            meta: {
              title: '质量报告审核',
              keepAlive: true
            },
            component: AsyncComponent('serviceass/qualityManage/audit')
          }
        ]
      }
    ]
  }
];
export default routers;
